Ext.define('Seq.svg.Selector', {
	        extend : 'Seq.svg.Base',

	        boxCls : {
		        fill : 'none',
		        stroke : '#55aaff',
		        'stroke-width' : 1,
		        'stroke-linecap' : 'round',
		        'stroke-linejoin' : 'round',
		        'stroke-dasharray' : "-"
	        },

	        box : null, // 选择框
	        canvas : null, // 画布
	        startXy : null, // 起点

	        start : function(e) {
		        var me = this, paper = me.canvas.svg.paper;
		        me.end();
		        me.startXy = me.getXy(e);
	        },

	        move : function(e) {
		        var me = this
		        if (me.startXy) {
			        if (me.box) {
				        var xy = me.getXy(e), rect = {
					        x : Math.min(xy.x, me.startXy.x),
					        y : Math.min(xy.y, me.startXy.y),
					        width : Math.abs(xy.x - me.startXy.x),
					        height : Math.abs(xy.y - me.startXy.y)
				        };

				        rect.x = Math.trunc(rect.x) - 0.5;
				        rect.y = Math.trunc(rect.y) - 0.5;
				        rect.x2 = Math.trunc(rect.x2) + 0.5;
				        rect.y2 = Math.trunc(rect.y2) + 0.5;

				        me.box.attr(rect);
			        } else {
				        var paper = me.canvas.svg.paper;
				        me.box = paper.rect(me.startXy.x, me.startXy.y, 0, 0).attr(me.boxCls);
			        }
		        }
	        },

	        end : function(e) {
		        var me = this;
		        if (me.box) {
			        me.selectByBox(e, me.box);
		        }
		        me.cancel();
	        },

	        cancel : function() {
		        var me = this;
		        if (me.box) {
			        me.box.remove();
			        me.box = null;
		        }
		        me.startXy = null;
	        },

	        selectByBox : function(e, box) {
		        var me = this, models = me.canvas.models, isPointInsideBBox = Snap.path.isPointInsideBBox, selected = [];
		        box = box.getBBox();
		        for (var i = 0, len = models.length; i < len; i++) {
			        var bbox = me.getBBox(models[i]);
			        if (isPointInsideBBox(box, bbox.x, bbox.y) && isPointInsideBBox(box, bbox.x2, bbox.y2)) {
				        selected.push(models[i]);
			        }
		        }
		        me.canvas.selectBox.selects(selected, e);
	        }

        });